package com.huirui.server.controller.mini.program;

import com.huirui.server.pojo.dto.FeedbackDto;
import com.huirui.server.pojo.result.Result;
import com.huirui.server.service.FeedbackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/feedback")
@Slf4j
@Validated
@Tag(name = "用户反馈管理", description = "微信小程序用户反馈相关API`")
public class FeedbackController {
    @Resource
    private FeedbackService feedbackService;

    @PostMapping
    @Operation(summary = "处理用户反馈")
    public Result<Void> addUserFeedback(@Valid @RequestBody FeedbackDto feedbackDto) {
        feedbackService.saveUserFeedback(feedbackDto);
        return Result.success();
    }
}
